<template>
  <div>
    <u-cell-group :border="false">
      <required-parameter />
      <cus-cell
        title="限制上传数量"
        :border="false"
        v-if="
          editConfigCom.attribute &&
          editConfigCom.attribute.hasOwnProperty('count')
        "
      >
        <div>
          <u-number-box
            v-model="editConfigCom.attribute.count"
            :max="10"
            :min="1"
          ></u-number-box>
        </div>
      </cus-cell>
      <block>
        <cus-cell
          title="上传提示语"
          :border="false"
          v-if="
            editConfigCom.attribute &&
            editConfigCom.attribute.hasOwnProperty('tipsText')
          "
        >
        </cus-cell>
        <div
          class="cell__body"
          v-if="
            editConfigCom.attribute &&
            editConfigCom.attribute.hasOwnProperty('tipsText')
          "
        >
          <u--textarea
            v-model="editConfigCom.attribute.tipsText"
            placeholder="请输入上传提示语"
            autoHeight
            count
            :border="false"
          />
        </div>
      </block>
      <!--      <cus-cell-->
      <!--        title="打开方式"-->
      <!--        :border="false"-->
      <!--        v-if="-->
      <!--          editConfigCom.attribute &&-->
      <!--          editConfigCom.attribute.hasOwnProperty('sourceType')-->
      <!--        "-->
      <!--      >-->
      <!--        <div>-->
      <!--          <u-checkbox-group v-model="editConfigCom.attribute.sourceType">-->
      <!--            <u-checkbox-->
      <!--              :customStyle="{ marginBottom: '8px', marginRight: '8px' }"-->
      <!--              label="使用相册"-->
      <!--              name="album"-->
      <!--            />-->
      <!--            <u-checkbox-->
      <!--              :customStyle="{ marginBottom: '8px' }"-->
      <!--              label="使用相机"-->
      <!--              name="camera"-->
      <!--            />-->
      <!--          </u-checkbox-group>-->
      <!--        </div>-->
      <!--      </cus-cell>-->
    </u-cell-group>
  </div>
</template>

<script>
import requiredParameter from "@/components/cusFormConfig/requiredParameter";
export default {
  components: { requiredParameter },
  computed: {
    pageData() {
      return this.$store.state.page.page;
    },
    editConfigComActiveId() {
      return this.$store.state.page.editConfigComActiveId;
    },
    activeIndex({ pageData, editConfigComActiveId }) {
      return pageData.items.findIndex((v) => v.id === editConfigComActiveId);
    },
    //组件本身属性
    editConfigCom({ pageData, activeIndex }) {
      return pageData.items[activeIndex];
    },
  },
  data() {
    return {};
  },
  created() {},
  methods: {},
};
</script>

<style scoped lang="scss">
.cell__body {
  display: flex;
  flex-direction: row;
  box-sizing: border-box;
  padding: 10px 15px;
  font-size: 15px;
  color: #303133;
  align-items: center;
  background-color: #F9F9F9;
  border-radius: 8px;
}
</style>
